Make the records tile total the cards, and date the census from the scan - #80
Conversation
The strip claimed 448,724 records while the page's own ten cards summed to 1,059,170, short by roughly the whole of TaxonMech, which was admitted after the tile was last edited by hand. Reported by the site owner, filed as #76. The tile is now the sum of the card counts, computed at assembly time. That is the right source as well as a self-consistent one: the cards cite each Mech's published browser, which the record-corpus census does not measure the same way, so totalling the census would have produced a third number rather than reconciling the two. assemble() refuses to build if a card has no count, and two tests hold the tile to the sum. The vocabulary tile is derived from the census too, and moves 43 to 45 on the refreshed scan: EMDB and MediaDive now appear in the corpora. The census itself is rerun for the nine measured Mechs, which is why the heatmap numbers move. prefix_census.py records its run date in the file it writes, and the note reads that rather than a month typed into the markup or the file's mtime, which git neither records nor restores. The note also counts its own coverage instead of spelling out "nine", so admitting a Mech cannot leave it claiming the wrong number. TaxonMech is still unmeasured: adding 625,960 records to the scanning passes would also add their record-subset indexes to the repository, and that is a size decision rather than a refresh. Prose that repeats these figures is updated to match the cards: the suite sentence on index.md, where the taxon figure read 100, and TraitMech on resources.md, which also gained a tenth trait category. Closes #76 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BXHrBTSU8fU4Zg7HfaMKs9
Review of this branch found assemble() reading the census run date with census.pop(), which removes the key from the caller's object. A second call with the same dictionary raised KeyError on a key the caller never touched. main() loads a fresh dictionary each run, so nothing shipped was affected. The test suite was one reordering away from it: a test renders twice and passes only because its second call raises the membership ValueError before reaching the pop. A function handed a parsed document should not consume it. Reads the field instead and filters underscore-prefixed metadata out of the Mech entries, with a test that renders twice and compares. Closes #81 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BXHrBTSU8fU4Zg7HfaMKs9
|
Adversarial review done, read-only, against What I checked beyond reading the diff:
Addressed here: #81, a real defect in this branch. Left filed: #82, that the tile sums ten different units under the word "records". A recipe, a taxon and a protein trait are different kinds of thing, and two of the ten cards call theirs structures. The total is still the most useful single number on the page and was always meant to be this sum, so this is an argument about the label, not the arithmetic. Renaming it is a wording call for whoever owns the page, not something to slip into a PR about a broken total. |
Replaces #73, which GitHub closed when its base branch was deleted on merging #77. Rebuilt onto main, and rethought: main's cards cite each Mech's published browser, not the record-corpus census, so the original approach of deriving card numbers from the census globs would have contradicted that design rather than fixing anything.
Closes #76. The strip claimed 448,724 records while the page's own ten cards summed to 1,059,170, short by roughly the whole of TaxonMech, which was admitted after the tile was last edited by hand.
The records tile is now the sum of the card counts, computed at assembly time. That is the right source as well as a self-consistent one: totalling the census instead would have produced a third number rather than reconciling the two, because the census measures a different corpus for ProteinTraitsMech and CultureMech and does not measure TaxonMech at all.
assemble()refuses to build if a card carries no count, and two new tests hold the tile to the sum.The census is rerun for the nine measured Mechs, which is why the heatmap numbers move. The vocabulary tile picks up EMDB and MediaDive, hence 43 to 45.
The census note dates itself from the scan.
prefix_census.pyrecords its run date in the file it writes, and the note reads that field rather than a month typed into the markup. Not the file's mtime: git neither records nor restores those, so a fresh clone would have dated the census to the day somebody cloned it. The note also counts its own coverage rather than spelling out "nine", so admitting a Mech cannot leave it claiming the wrong number.TaxonMech stays unmeasured. Adding 625,960 records to the scanning passes would also add their record-subset indexes to the repository, and that is a size decision rather than a refresh. The note says so on the page.
Prose updated to match the cards: the suite sentence on
index.md, where the taxon figure read 100 against a corpus of 625,960, and TraitMech onresources.md, which also gained a tenth trait category.Checks: 15 tests pass and
assemble_page.py --checkreports the page current. Verified in Chrome at 1400px: five tiles on one row, heatmap with no horizontal overflow.🤖 Generated with Claude Code
https://claude.ai/code/session_01BXHrBTSU8fU4Zg7HfaMKs9